<?php


namespace app\common\library;


use think\Queue;

class QueueApi
{
    //复制商品
    public static function copy($data){
        \think\Log::write('准备进入--copy--'.json_encode($data));
        self::push('app\common\library\jobs\Goods@copy',$data,'wanlshop');
    }

    //更新商家商品价格高
    public static function pricing($data){
        \think\Log::write('准备进入--pricing--'.json_encode($data));
        self::push('app\common\library\jobs\Goods@pricing',$data,'wanlshop');
    }

    // 澳邮上传身份证
    public static function auUploadIdcard($data,$delay){
        \think\Log::write('准备进入--auUploadIdcard--'.json_encode($data));
        self::later($delay,'app\common\library\jobs\Order@auUploadIdcard',$data,'wanlshop');
    }

    // 打印发货单
    public static function auPrint($data,$delay){
        \think\Log::write('准备进入--auPrint--'.json_encode($data));
        self::later($delay,'app\common\library\jobs\Order@auPrint',$data,'wanlshop');
    }

    public static function push($job, $data = '', $queue = null){
        return Queue::push($job, $data, $queue);
    }

    public static function later($delay, $job, $data = '', $queue = null){
        return Queue::later($delay,$job, $data, $queue);
    }
}